﻿@model IList<Nop.Admin.Models.Logistics.PackageNoteModel>
@using Nop.Core.Domain.Shipping;
@using Nop.Core.Domain.Logistics;

@if (Model.Count > 0)
{
    <br /><br />
    <table border="1">
        <tr>
            <th>@Html.LabelFor(m => m[0].CreatedOn)</th>
            <th>@Html.LabelFor(m => m[0].TypeString)</th>
            <th>@Html.LabelFor(m => m[0].CustomerId)</th>
            <th>@Html.LabelFor(m => m[0].PackageId)</th>
            <th>@Html.LabelFor(m => m[0].DisplayToCustomer)</th>
            <th>@Html.LabelFor(m => m[0].ShippingStatus)</th>
            <th>@Html.LabelFor(m => m[0].Address)</th>
            <th>@Html.LabelFor(m => m[0].Note)</th>
        </tr>

        @for ( var idx = 0; idx < Model.Count(); idx++ )
        {
            var addressIdStr = Model[idx].AddresId.HasValue ? Model[idx].AddresId.Value.ToString() : String.Empty;
            <tr>
                <td>@Html.DisplayFor(m => m[idx].CreatedOn)</td>
                <td>@Html.DisplayFor(m => m[idx].TypeString)</td>
                <td>@Html.ActionLink(Model[idx].CustomerEmail, "Edit", "Customer", new { id = Model[idx].CustomerId }, null)</td>
                <td>@Html.DisplayFor(m => m[idx].PackageId)</td>
                <td>@Html.DisplayFor(m => m[idx].DisplayToCustomer)</td>
                <td>@Html.DisplayFor(m => m[idx].ShippingStatus)</td>
                <td>@addressIdStr</td>
                <td style = "max-width: 200px; max-height: 50px; word-wrap: break-word">
                    @Html.DisplayFor(m => m[idx].Note)

                </td>
            </tr>   
        } 
            
    </table>
}